// pages/integral/recordex/index.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    headTop: "",
    headHeight: "",
    sumHeight: "",
    screenHeight: "",
    integral: "",
    cell: [],
    isCell: true
  },
  onLoad(options) {
    const that = this;
    console.log(options.integral)
    that.setData({
      headTop: app.globalData.headTop,
      headHeight: app.globalData.headHeight,
      sumHeight: app.globalData.sumHeight,
      integral: options.integral
    });
  },
  onShow() {
    const that = this;
    const query = wx.createSelectorQuery();
    query.select(".cards").boundingClientRect();
    query.exec((res) => {
      let screenHeight =
        (app.globalData.screenHeight - res[0].top - 65) * 2 + "rpx";
      that.setData({
        screenHeight,
      });
    });
    that.getintegralList()
  },
  getintegralList() {
    app.http.post(app.api.integralList, {}, (res) => {
      if (res.data == "") {
        this.setData({
          cell: res.data,
          isCell: true
        })
      } else {
        this.setData({
          cell: res.data,
          isCell: false
        })
      }
    })

  },
  back() {
    wx.navigateBack({
      delta: 1,
    });
  },
  linkTointegra() {
    wx.navigateTo({
      url: "/pages/person/record/index",
    });
  },
});